--Execute as OE
--- query3.sql
--- Cache result of both queries, then use the cached result.
set timing on
set echo on

select /*+ result_cache q_name(Q1) */ * from orders
/


select c.customer_id, o.ord_count
 from (select /*+ result_cache q_name(Q3) */
      customer_id, count(*) ord_count
      from orders
      group by customer_id) o, customers c
 where o.customer_id = c.customer_id
/


set echo off

